# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kcodecs
pkgver=5.95.0
pkgrel=0
pkgdesc="Provide a collection of methods to manipulate strings using various encodings"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-only AND LGPL-2.1-or-later"
makedepends="
	doxygen
	extra-cmake-modules
	gperf
	graphviz
	qt5-qttools-dev
	samurai
	"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kcodecs-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E "(rfc2047|kcharsets)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
b802ba6b6ceaae8b1272d7f0f2cc33e76f62de4e35e09e841e94010da25b1acf8372d4bcf69167365f1147a2f356748ec8418bef5a2d54874cd14ff73ab5014b  kcodecs-5.95.0.tar.xz
"
